//	mpsf.noteseq.core.h
#pragma once

#define _CRT_SECURE_NO_DEPRECATE
#define WIN_VERSION
#include <max/ext.h>
#include <max/ext_obex.h>

typedef long t_velocity;
#define VEL_MAX 127
typedef long t_pitch;
#define PITCH_MAX 127

typedef struct _noteseq_t
{
	t_object _obj;
	void*	_obex;
	long	_numsteps;
	long	_curstep;
	t_velocity **_noteseq;
	t_velocity *_prevnotes;
	void*	_notemesgout;
} t_noteseq;

void* ns_new(long numsteps);
void ns_free(t_noteseq *x);
void ns_setnote(t_noteseq *x, long step, long pitch, long velocity);
void ns_clearseq(t_noteseq *x);
void ns_step(t_noteseq *x, long step);
void ns_flushnotes(t_noteseq *x);

void _ns_outputnoteon(t_noteseq *x, t_pitch pitch, t_velocity velocity);
void _ns_outputnoteoff(t_noteseq *x, t_pitch pitch);

